﻿import QtQuick 2.0
import "../../common"
import "../../../js/util.js" as Util
import "../../../js/UI.js" as Style
import "../../../js/UI.js" as UI

Item{
    id:topMenu
    z:10
    width: parent.width
    height:parent.height
    property var data_p: ""
    property var finishedcallback: null
    signal sure_cancel_signal(var value)
    Keys.onReleased: if(event.key == Qt.Key_Back) {event.accepted = true;finishedcallback();m_stackView_id.forceActiveFocus();}
    Component.onCompleted: forceActiveFocus()
    Rectangle{
        width: parent.width
        height:parent.height
        color: "#000000"
        opacity: 0.3
        MouseArea{
            anchors.fill: parent
            onClicked: finishedcallback()
        }
    }
    MouseArea {
        anchors.fill: parent//
        onClicked:
        {
        }
    }
    Rectangle{
        z:10
        height: Util.isHDScreen()?m_lineValue*4:m_lineValue*3.6+2
        width: Util.isHDScreen()?m_lineValue*10:parent.width-m_lineValue*1.6
        radius: m_lineValue*0.2
        anchors.centerIn: parent;
        color: "white"
        AText{
            text:data_p
            font.pointSize: UI.fontContentSize
            lineHeight:m_lineValue*0.6
            lineHeightMode:Text.FixedHeight
            width: paintedWidth > parent.width*0.8 ? parent.width*0.8:paintedWidth
            wrapMode:Text.WordWrap
            anchors.horizontalCenter: parent.horizontalCenter;
            anchors.top: parent.top
            anchors.topMargin:( parent.height - paintedHeight - sureTr.height) * 0.5
        }
        RadiusBotton{
            id:sureTr
            width: parent.width*0.5
            height:0.32 * parent.height
            anchors.bottom: parent.bottom
            anchors.left: parent.left
            m_text: "确定"
            m_Text.color: Style.ItemTextColor
            btnEnable: false
            onCanvasClicked:{
                sure_cancel_signal(true)
                finishedcallback()
            }
        }
        RadiusBotton
        {
            width: parent.width*0.5
            height:0.32 * parent.height
            anchors.bottom: parent.bottom
            anchors.right: parent.right
            m_text: "取消"
            btnEnable: true
            onCanvasClicked:{
                sure_cancel_signal(false)
                finishedcallback()
            }
        }
        SplitLine{
            width: parent.width
            anchors.top: sureTr.top
            anchors.left: parent.left
        }
        Vertical_Line{
            height: sureTr.height
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.bottom: parent.bottom
        }
    }
}
